package edu.sctu.zhangwang.month201506.day20150601;

import java.util.HashMap;

//import com.texttrain.main.appbean.PeopleAppbean;
//import com.texttrain.main.json_data.SetTrianData;

/**
 * 
 * ������������
 * 
 * @author teacher0
 *
 */
public class CardDeth {

	private HashMap<String, Integer> map;

	public CardDeth() {
		map = new SetTrianData().setHashMapData();
	}

	public void getCard(String start, String end) {
		
		
        
	}

	public int getCount(String start, String end) {
		int count = 0;
		if (map.get(start) > map.get(end)) {
			count = map.get(start) - map.get(end);
		} else {
			count = map.get(end) - map.get(start);
		}
		return count;
	}

	public int getPrice(String start, String end) {
		int price = 2;
		if (getCount(start, end) < 3) {
			price = 2;
		} else if (getCount(start, end) >= 3 && getCount(start, end) < 6) {
			price = 4;
		} else if (getCount(start, end) >= 6 && getCount(start, end) < 8) {
			price = 5;
		} else if (getCount(start, end) >= 8) {
			price = 6;
		}
		return price;
	}
	
	/**
	 * ��ֵ���
	 * 
	 * @param price
	 */
	public void setPrice(int price,PeopleAppbean people){
		people.setPice(people.getPice()+price);
	}

}
